using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using FikriKibar.Entities.Concrete;

namespace FikriKibar.DataAccess.Mapping
{
    public class LanguageHistoryMapping : EntityTypeConfiguration<LanguageHistory>
    {
        public LanguageHistoryMapping()
            : this("dbo")
        {
        }
 
        public LanguageHistoryMapping(string schema)
        {
            ToTable(schema + ".LanguageHistory");
            HasKey(x => x.Id);

            Property(x => x.Id).HasColumnName("Id").IsRequired().HasColumnType("int").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.LanguageId).HasColumnName("LanguageId").IsRequired().HasColumnType("int");
            Property(x => x.LanguageCode).HasColumnName("LanguageCode").IsRequired().HasColumnType("nvarchar").HasMaxLength(10);
            Property(x => x.LanguageName).HasColumnName("LanguageName").IsRequired().HasColumnType("nvarchar").HasMaxLength(255);
            Property(x => x.CreateDate).HasColumnName("CreateDate").IsRequired().HasColumnType("datetime");
            Property(x => x.CreatedBy).HasColumnName("CreatedBy").IsRequired().HasColumnType("int");
            Property(x => x.UpdateDate).HasColumnName("UpdateDate").IsRequired().HasColumnType("datetime");
            Property(x => x.UpdatedBy).HasColumnName("UpdatedBy").IsRequired().HasColumnType("int");
            Property(x => x.PublishBeginDate).HasColumnName("PublishBeginDate").IsRequired().HasColumnType("datetime");
            Property(x => x.PublishEndDate).HasColumnName("PublishEndDate").IsRequired().HasColumnType("datetime");
            Property(x => x.DisplayOrder).HasColumnName("DisplayOrder").IsRequired().HasColumnType("int");
            Property(x => x.IsApproved).HasColumnName("IsApproved").IsRequired().HasColumnType("bit");
            Property(x => x.IsDeleted).HasColumnName("IsDeleted").IsRequired().HasColumnType("bit");
        }
    }

}
